package com.wxp.demo04.global;

import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;

import com.wxp.demo04.R;

/**
 * 3.3 注册快捷方式
 */
public class ShortcutsActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_shortcuts);


        this.setTitle("3.3 注册快捷方式");
        findViewById(R.id.btn_zywj).setOnClickListener(this);
        findViewById(R.id.btn_ysj).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent();
        if (view.getId() == R.id.btn_zywj) {
            ComponentName component = new ComponentName(this, ReadStringActivity.class);
            intent.setComponent(component);
            startActivity(intent);
        } else if (view.getId() == R.id.btn_ysj) {
            ComponentName component = new ComponentName(this, MetaDataActivity.class);
            intent.setComponent(component);
            startActivity(intent);
        }
    }
}